package com.training.food.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.training.food.Mapper.UserMapper;
import com.training.food.pojo.User;
import com.training.food.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl extends ServiceImpl<UserMapper, User>implements LoginService {
    @Autowired
    UserMapper userMapper;
    @Override
    public User login(User user) {
        return userMapper.findUser(user.getUsername(),user.getPassword());
    }

    @Override
    public void change(User user) {
        userMapper.chengeNoLogin(user.getUsername(),user.isNoLogin());
    }

    @Override
    public void freeze(User user) {
        userMapper.freeze(user);
    }

    @Override
    public User select(User user) {
        return userMapper.findByUsername(user.getUsername());
    }
}
